using System;
using Ext.Toolbar;

namespace PageScripts {
    public class UIHelper {
        public static Button CreateButton(string text, string tooltip, string cssClass, Callback fn, object scope) {
            return new Button(
                new ButtonConfig()
                    .text(text)
                    .tooltip(new Dictionary("title", text, "text", tooltip, "animate", true, "trackMouse", true))
                    .cls("x-btn-text-icon " + cssClass)
                    .handler(fn)
                    .scope(scope)
                    .ToDictionary()
            );
        }

    }
}
